/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"25F924F1-409C-4039-8295-EC4AA1F5504C"}
 */
var fTotales = null;

/**
 * @properties={typeid:24,uuid:"0BF35630-F20D-4465-A12B-806AE7E472A0"}
 */
function buscarTotalesMadera()
{
	var query = 'SELECT p.maderas_id as "Madera", SUM(cantidad_alter) as "Total" FROM recep_detalle as "r" '+
				'join productos as "p" on p.cod_producto = r.cod_producto '+
				'where recep_cabecera_id = ? '+ 
				'group by p.maderas_id '+
				'order by maderas_id'
	var max = -1
	var args = [recep_cabecera_id]
	var ds = databaseManager.getDataSetByQuery('infocom',query,args,max)
	
	fTotales = '<html>'+ds.getAsHTML(null,null,null,true)+'</html>'
}

/**
 * Handle record selected.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"97701CB8-1C55-4588-AD75-9FEDB031F9C7"}
 */
function onRecordSelection(event) {
	if (tipo == 0)
	{
		elements.grp_cliente.visible	= 0
		elements.grp_proveedor.visible 	= 1
		elements.tabs_180.tabIndex		= 2
	}
	else
	{
		elements.grp_cliente.visible	= 1
		elements.grp_proveedor.visible 	= 0
		elements.tabs_180.tabIndex		= 1
	}
}
